package base.test6.outputformat;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;


import java.io.IOException;

public class LogReducer extends Reducer<Text, NullWritable,Text,NullWritable> {

    @Override
    protected void reduce(Text key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        //防止相同数据，丢失数据，进行遍历，保证每一条数据都能进行输出
        for (NullWritable value : values){
            context.write(key,NullWritable.get());
        }
    }
}
